package depthtag.filter;
import java.io.File;
import java.io.FilenameFilter;


public class GeneralFileFilter implements FilenameFilter {
	String[] filenamesAccepted;

	public GeneralFileFilter(String[] filenamesAccepted) {
			super();
			this.filenamesAccepted = filenamesAccepted;
	}
	@Override
	public boolean accept(File dir, String name) {
		if(name != null){
			name = name.toLowerCase();
			for (String fileName  : filenamesAccepted) {
				if(name.endsWith(fileName)){
					return true;
				}
			}
		}
		return false;
	}
	
}
